<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>001-定义变量.html</title>
</head>
<body>
	
</body>
<script>
	/*
	var a =1
	var a =2
	console.log("var:",a)
	console.log("var:",window.a)

	let b = 1
	let b = 2
	console.log("let:",b)
	*/
	/*
	console.log(a)
	console.log(b)
	var a = 1
	var a = 2
	*/
	/*
	function fn1(){
		let a = 1
		console.log(a)
		function fn2(){
			console.log(a)
		}
		fn2()
	}
	fn1()
	console.log(a)
	*/
	if(true){
		let a = 1
		console.log(a)//出花括号内访问不了
	}
	// console.log(a)

</script>
</html>